<?php

use yii\grid\GridView;
use common\helpers\Html;
use kartik\select2\Select2;
$this->title = '人才信息管理';
$this->params['breadcrumbs'][] = ['label' => $this->title];

?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">
                    <?= $this->title; ?>
                    <small></small>
                </h3>
                <div class="box-tools">
                </div>
            </div>
            <div class="box-body table-responsive">
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'filterModel' => $searchModel,
                   // 'group'=>$group,
                    // 重新定义分页样式
                    'tableOptions' => ['class' => 'table table-hover'],
                    'columns' => [
                        [
                            'class' => 'yii\grid\SerialColumn',
                        ],
                        'name',
                        'phone',
                        [
                            'attribute' => 'cate.position',
                        ],
                        //自定义搜索 班级
                        [
                            'attribute' => 'cates.title',
                            'filter'=>Select2::widget(['name' => 'SearchModel[grade]',
                                'data' => $menuDropDownLists,
                                'value' =>$searchModel->grade,
                            ]),
                            'filterInputOptions' => ['class' => 'form-control', 'id' => null, 'prompt' => '全部'],
                        ],
                        [
                            'header' => "操作",
                            'class' => 'yii\grid\ActionColumn',
                            'template' => '{ajax-edit} {status} {destroy}',
                            'buttons' => [
                                'ajax-edit' => function ($url, $model, $key) use ($group) {
                                    return Html::edit(['upper', 'id' => $model->personnel_id,'group'=>$group], '新增成员',[
                                    ]);
                                },

                            ],
                        ],
                    ],
                ]); ?>
            </div>
        </div>
    </div>